package com.clw.template.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.clw.template.enums.MenuEnum;
import com.clw.template.validator.EnumValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 权限表参数
 * </p>
 *
 * @author clw
 * @since 2019-11-01
 */
@Data
@ApiModel(value="SysPermissionParam对象", description="权限表参数")
public class SysPermissionParam implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "上级不能为空")
    @ApiModelProperty(value = "上级id(0为顶级)")
    private Long pId;

    @EnumValid(target = MenuEnum.class, message = "type取值必须为目录、菜单、按钮或其它")
    @ApiModelProperty(value = "类型（0->目录,1->菜单,2->按钮,3->其它）")
    private MenuEnum type;

    @NotBlank(message = "名称不能为空")
    @ApiModelProperty(value = "名称")
    private String name;

    @NotBlank(message = "权限不能为空")
    @ApiModelProperty(value = "权限")
    private String permission;

    @ApiModelProperty(value = "选中的数组（给前端提供）")
    private Integer[] selected;

}
